Skip to main content

Using Glific APIs for OTP Authentication

Prerequisites:

Steps:

  1. Apply for an OTP template in Glific if not already present. Get the ID of the template from the URL. Will be used later to send the message.
  1. Check if the contact is present on Glific using the ContactByPhone API.
  1. If the contact is present and the bspStatus of the contact is not null then you can send an OTP template message using createAndSendMessage API. Also you can check other fields like collections and fields of the contact using the API in point no 2. If the contact is not present on Glific then you need to Create a contact using createContact API Optin the contact using optin API provided you have taken consent from the user in any form Send the OTP template using the API mentioned in point 3